﻿using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Activation;
using System.ServiceModel.Web;
using System.Text;
using Ashlen.Portal.Core;
using Ashlen.Portal.Core.DTO;
using Ashlen.Portal.Core.DataInterfaces;
using Ashlen.Portal.Data;
using Ashlen.Portal.Services.BindingExtensions;

namespace Ashlen.Portal.Services
{
    [ServiceContract]
    public interface IAdministrationService
    {
        [OperationContract]
        [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        [JSONPBehavior(callback = "callback")]
        string GetRoles();

        [OperationContract]
        [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        [JSONPBehavior(callback = "callback")]
        string SaveRole(string roleId, string roleName, string description);

        [OperationContract]
        [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        [JSONPBehavior(callback = "callback")]
        string DeleteRole(string roleId);

        [OperationContract]
        [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        [JSONPBehavior(callback = "callback")]
        string GetUsers(string partialUserName);

        [OperationContract]
        [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        [JSONPBehavior(callback = "callback")]
        string GetUsersWithRoles(string partialUserName);

        [OperationContract]
        [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        [JSONPBehavior(callback = "callback")]
        string DeleteUser(string userId);

        [OperationContract]
        [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        [JSONPBehavior(callback = "callback")]
        string AddUserToRole(string userId, string roleId);

        [OperationContract]
        [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        [JSONPBehavior(callback = "callback")]
        string DeleteUserFromRole(string userId, string roleId);
    }
}
